﻿using System;
public abstract class Animal
{
    public string Name { get; set; }
    public Animal(string name)
    {
        Name = name;
    }
    public abstract void Enjoy();
}
public class Cat : Animal
{
    public string EyesColor { get; set; }

    public Cat(string name, string eyesColor) : base(name)
    {
        EyesColor = eyesColor;
    }

    public override void Enjoy()
    {
        Console.WriteLine($"{Name}（一只{EyesColor}眼睛的猫）笑了笑。");
    }
}
public class Dog : Animal
{
    public string FurColor { get; set; }

    public Dog(string name, string furColor) : base(name)
    {
        FurColor = furColor;
    }
    public override void Enjoy()
    {
        Console.WriteLine($"{Name}（一只{FurColor}毛发的狗）叫一叫");
    }
}
public class Lady
{
    public string Name { get; set; }
    public Animal Pet { get; set; }
    public Lady(string name, Animal pet)
    {
        Name = name;
        Pet = pet;
    }
    public void MyPetEnjoy()
    {
        Console.WriteLine($"{Name}的宠物开始表现出高兴的样子：");
        Pet.Enjoy();
    }
}
class Program
{
    static void Main(string[] args)
    {
        // 创建张女士，养了一只猫
        Cat cat = new Cat("咪咪", "蓝色");
        Lady msZhang = new Lady("王女士", cat);
        msZhang.MyPetEnjoy();
        // 创建王女士，养了一只狗
        Dog dog = new Dog("旺财", "金黄色");
        Lady msWang = new Lady("牛女士", dog);
        msWang.MyPetEnjoy();

        Console.ReadLine();
    }
}
